<!DOCTYPE html>
<html lang="en">
<head>
    {{ $task := index .TaskList 0 }}
    <meta charset="UTF-8">
    <title>浩盛Todo - 更改任务</title>
    {{ template "imports" . }}
    <style>
        #edit-form {
            width: 45%;
            margin-left: calc((100% - 45%) / 2);
        }

        #edit-form input[type="submit"] {
            width: 50%;
        }
    </style>
</head>
<body>
<div class="container">
    {{ template "nav" . }}
    <article>
        <h2 class="m-4 text-center">更改任务</h2>
        <form action="/task/edit" method="post" class="text-center" id="edit-form" name="edit-form">
            <section class="mb-2 input-group">
                <label for="task-date" class="input-group-text">任务日期：</label>
                <input type="text" class="form-control" id="task-date" name="date" placeholder="任务日期"
                       value="{{ $task.Date }}" readonly>
            </section>
            <section class="mb-2 input-group">
                <label for="task-name" class="input-group-text">任务名称：</label>
                <input type="text" class="form-control" id="task-name" name="name" value="{{ $task.Name }}"
                       placeholder="输入任务名称" autocomplete="off" required maxlength="128">
            </section>
            <section class="mb-2 input-group">
                <label for="task-desc" class="input-group-text" style="vertical-align: top;">任务描述：</label>
                <textarea class="form-control" id="task-desc" rows="5" name="desc" placeholder="输入任务描述"
                          autocomplete="off" required maxlength="1024">{{ $task.Desc }}</textarea>
            </section>
            <input type="submit" id="edit-btn" value="确认更改" class="btn btn-primary">
        </form>
    </article>
</div>
</body>
</html>